package com.hp.gxw.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hp.gxw.entity.Process;
import com.hp.gxw.service.ICustomerService;
import com.hp.gxw.service.IProcessService;
import com.hp.gxw.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/manage/selectList")
public class SelectListController {

    @Autowired
    private ICustomerService iCustomerService;

    @Autowired
    private IProductService iProductService;

    @Autowired
    private IProcessService iProcessService;

    @RequestMapping("/customerList")
    @ResponseBody
    public Object customerList(){
        return iCustomerService.list();
    }

    @RequestMapping("/productList")
    @ResponseBody
    public Object productList(){
        return iProductService.list();
    }

    @RequestMapping("/processList")
    @ResponseBody
    public Object processList(String type){
        return iProcessService.list(new LambdaQueryWrapper<Process>().eq(Process::getType, type));
    }
}
